package com.saianfu.flowable.demo.config

import org.springframework.context.annotation.Configuration
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter

/**
 *
 * @author pei
 * @date 2020-07-22
 */
@Configuration
@EnableWebSecurity(debug = true)//已经自动配置了，此处只是为了打印debug信息
class WebSecurityConfiguration : WebSecurityConfigurerAdapter() {

    override fun configure(http: HttpSecurity?) {
        http?.let {
            it.csrf().disable().authorizeRequests()
                    .antMatchers("/druid/**")
                    .permitAll()
                    .anyRequest()
                    .permitAll()
        }
    }
}